import { moduleRequest } from '@/utils/request'

const request = moduleRequest('')
/**
 * 登录
 *
 * @author yubaoshan
 * @date 2022-09-22 22:33:20
 */
export default {
	// B端获取图片验证码
	getPicCaptcha(data) {
		return request('open/captcha/get-pic-captcha', data, 'get')
	},
	// B端获取手机验证码
	getPhoneValidCode(data) {
		return request('open/captcha/get-phone-valid-code', data, 'post')
	},
	// 账号密码登录
	login(data) {
		return request('open/auth/login', data, 'post', false)
	},
	// 手机验证码登录
	loginByPhone(data) {
		return request('open/auth/login', data, 'post', false)
	},
	// 退出
	logout(data) {
		return request('open/auth/logout', data, 'get')
	},
	// 获取用户信息
	getLoginUser(data) {
		return request('user/info', data, 'get')
	},
	// 获取租户站点信息
	getTenantSiteInfoByHost(host) {
		return request('open/auth/tenant-site/' + host, null, 'get')
	}
}
